package com.cmict.data.system.controller.admin.user.vo.user;

import com.cmict.data.framework.common.validation.Mobile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Set;

@ApiModel("管理后台 - 用户信息 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode()
public class UserExtRespVO  {

    @ApiModelProperty(value = "用户编号", required = true, example = "1")
    private Long id;

    @ApiModelProperty(value = "登录名称", required = true, example = "")
    @NotBlank(message = "登录名称不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "登录名称由 数字、字母 组成")
    @Size(min = 4, max = 30, message = "登录名称长度为 4-30 个字符")
    private String username;

    @ApiModelProperty(value = "用户密码", required = true, example = "")
    @NotBlank(message = "用户密码不能为空")
    private String password;

    @ApiModelProperty(value = "用户昵称", required = true, example = "awesome")
    @Size(max = 30, message = "用户昵称长度不能超过30个字符")
    private String nickname;

    @ApiModelProperty(value = "备注", example = "我是一个用户")
    private String remark;

    @ApiModelProperty(value = "部门ID", example = "我是一个用户")
    private Long deptId;

    @ApiModelProperty(value = "岗位编号数组", example = "1")
    private Set<Long> postIds;

    @ApiModelProperty(value = "用户邮箱", example = "awesome@guanli.cn")
    @Email(message = "邮箱格式不正确")
    @Size(max = 50, message = "邮箱长度不能超过 50 个字符")
    private String email;

    @ApiModelProperty(value = "手机号码", example = "15601691300")
    @Mobile
    private String mobile;

    @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类")
    private Integer sex;

    @ApiModelProperty(value = "用户头像", example = "")
    private String avatar;

    @ApiModelProperty(value = "租户编号", required = true, example = "1")
    private Long tenantId;
    @ApiModelProperty(value = "租户编号", required = true, example = "1")
    private String tenantName;
}
